import {defineStore} from 'pinia'
import config from "@/config";

export const useAppStore = defineStore({
    id: 'app',
    state: () => {
        return {
            tab: true,
            layoutTags: config.layoutTags,
            inverted: false,
            routerAlive: true,
            collapse: false,
            locale: config.locale,
            layout: config.layout,
            theme: config.theme,
            breadcrumb: true,
            sideWidth: config.asideWidth,
            sideTheme: 'light',
            headerTheme: 'dark',
            greyMode: false,
            accordion: true,
            tagsTheme: 'concise',
            themeVariable: {
                "--global-checked-color": "#5fb878",
                "--global-primary-color": "#009688",
                "--global-normal-color": "#1e9fff",
                "--global-danger-color": "#ff5722",
                "--global-warm-color": "#ffb800",
                "--global-border-radius": "1px"
            },
        }
    },
    persist: {
        storage: localStorage,
        paths: ['tab', "headerTheme", 'layoutTags', "layout", 'locale', 'theme', 'inverted', 'breadcrumb', 'sideTheme', 'greyMode', 'accordion', 'themeVariable', 'subfield', 'tagsTheme'],
    }
})

export default useAppStore;
